Tom Kelly
PhD Graduate from University Otago, Dunedin, New Zealand
Freelance Consultant at Tohoku University, Sendai, Miyagi
Twitter @tomkXY
GitHub TomKellyGenetics
2018/03/03
datasauRus package
data(iris)
boxplot(iris$Sepal.Length[iris$Species=="setosa"],
iris$Sepal.Length[iris$Species=="versicolor"],
iris$Sepal.Length[iris$Species=="virginica"],
names=c("setosa", "versicolor", "virginica"))library("vioplot")vioplot(iris$Sepal.Length[iris$Species=="setosa"],
iris$Sepal.Length[iris$Species=="versicolor"],
iris$Sepal.Length[iris$Species=="virginica"],
names=c("setosa", "versicolor", "virginica"))library("devtools")
devtools::install_github("TomKellyGenetics/vioplotx")
library("vioplotx")
vioplotx(iris$Sepal.Length[iris$Species=="setosa"],
iris$Sepal.Length[iris$Species=="versicolor"],
iris$Sepal.Length[iris$Species=="virginica"],
names=c("setosa", "versicolor", "virginica"))vioplot(Sepal.Length~Species, data = iris)## Error in min(data): invalid 'type' (language) of argument
vioplotx(Sepal.Length~Species, data = iris)vioplotx(Sepal.Length~Species, data=iris, main="Sepal Length",
log="y", ylim=c(log(4), log(9)))vioplotx(Sepal.Length~Species, data=iris, main="Sepal Length",
log="y", ylim=c(log(4), log(9)))
axis(2, at=log(1:10), labels=1:10)vioplotx(Sepal.Length~Species, data = iris,
col="lightblue")vioplotx(Sepal.Length~Species, data = iris,
col=c("lightgreen", "lightblue", "palevioletred"))vioplotx(Sepal.Length~Species, data = iris, main = "Sepal",
ylab="Length", xlab="Species", names=c("A", "B", "C"),
col=c("lightgreen", "lightblue", "palevioletred"))
legend("topleft", title="Species", cex = 0.75,
legend=c("setosa", "versicolor", "virginica"),
fill=c("lightgreen", "lightblue", "palevioletred"))vioplotx(Sepal.Length~Species, data = iris,
col="lightblue", border="royalblue",
rectCol="palevioletred", lineCol="violetred",
colMed="violet", colMed2="purple", pchMed=23)vioplotx(Sepal.Length~Species, data = iris,
col=c("lightgreen", "lightblue", "palevioletred"),
border=c("darkolivegreen4", "royalblue4", "violetred4"),
rectCol=c("forestgreen", "blue", "palevioletred3"),
lineCol=c("darkolivegreen", "royalblue", "violetred4"),
colMed=c("green", "cyan", "magenta"), pchMed=c(15, 17, 19))vioplotx(Sepal.Length~Species, data = iris, areaEqual=TRUE,
col=c("lightgreen", "lightblue", "palevioletred"),
border=c("darkolivegreen4", "royalblue4", "violetred4"),
rectCol=c("forestgreen", "blue", "palevioletred3"),
lineCol=c("darkolivegreen", "royalblue", "violetred4"),
colMed=c("green", "cyan", "magenta"), pchMed=c(15, 17, 19))iris_large <- iris[iris$Sepal.Width > mean(iris$Sepal.Width), ]
iris_small <- iris[iris$Sepal.Width <= mean(iris$Sepal.Width), ]vioplotx(Sepal.Length~Species, data=iris_large, col = "palevioletred", plotCentre = "line", side = "right",
main="Iris Data", xlab = "Species", ylab = "Sepal Length")
vioplotx(Sepal.Length~Species, data=iris_small, col = "lightblue", plotCentre = "line", side = "left", add = T)
legend("topleft", fill = c("lightblue", "palevioletred"), legend = c("small", "large"), title = "Sepal Width", cex=1.25)